hysop.backend.device.opencl.operator.directional.advection_dir module

class hysop.backend.device.opencl.operator.directional.advection_dir.OpenClDirectionalAdvection(force_atomics=False, relax_min_particles=False, remesh_criteria_eps=None, **kwds)[source]

Bases: DirectionalAdvectionBase, OpenClDirectionalOperator

Particular advection of field(s) in a given direction, on opencl backend, with remeshing.

OpenCL kernels are build once per dimension in order to handle directional splitting with resolution non uniform in directions.

Parameters:
  • velocity (Field) – Continuous velocity field (all components)

  • advected_fields (Field or array like of Fields) – Instance or list of continuous fields to be advected.

  • advected_fields_out (Field or array like of Field) – Where input fields are remeshed

  • variables (dict) – Dictionary of continuous fields as keys and topologies as values.

  • velocity_cfl (float) – Velocity cfl in given direction.

  • force_atomics (bool) – If set, only use atomic accumulators for remesh. Default: autotuner will automatically figure out the best strategy between using atomic operations and remeshing multiple particles at a time.

  • relax_min_particles (bool) – Relax the minimum particles required for correct accumulation of remeshed quantities in cache when not using atomic operations. If this is set to True, the minimum number will be reset to 2. The minimum number of particles to be remeshed at a time, by a work_item is 2*ceil(scalar_cfl) because of maximum potential particles superposition after the advection step.

  • remesh_criteria_eps (int) – Minimum number of epsilons (in specified precision) that will trigger remeshing. By default every non zero value is remeshed.

  • kwds – Extra parameters passed to generated directional operators.

velocity

Continuous velocity field (all components)

Type:

Field

advected_fields_in

List of continuous fields to be advected.

Type:

list

advected_fields_out

List of output continuous fields.

Type:

list

DEBUG = False
apply(**kwds)

Abstract method that should be implemented. Applies this node (operator, computational graph operator…).

setup(work)[source]

Setup temporary buffer that have been requested in get_work_properties(). This function may be used to execute post allocation routines. This sets self.ready flag to True. Once this flag is set one may call ComputationalGraphNode.apply() and ComputationalGraphNode.finalize().

Automatically honour temporary field memory requests.

classmethod supports_mpi()[source]

Return True if this operator was implemented to support multiple mpi processes.